#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    ,widget(new ScreenShotWidget(this))
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    if(widget!=nullptr){
        widget->deleteLater();
        widget=nullptr;
    }
    widget=new ScreenShotWidget();
    widget->showFullScreen();
}
